package com.klm.datakeeper;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.klm.datakeeper.filemonitoring.FileModificationService;
import com.klm.datakeeper.smsbackup.SmsSync;

public class StartActivity extends Activity{
	
	
	private static boolean isFileModificationServiceIsStarted = false;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.start_activity);
		if(!isFileModificationServiceIsStarted){
			startService(new Intent(getApplicationContext(), FileModificationService.class));
			isFileModificationServiceIsStarted = true;
		}
		
		Button openBackupFilePathsButton = (Button) findViewById(R.id.open_backup_file_paths_button);
		openBackupFilePathsButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent  = new Intent(getApplicationContext(), EditFilePathsActivity.class);
				startActivity(intent);
			}
		});
		
		Button showStatsButton = (Button) findViewById(R.id.show_stats_button);
		showStatsButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent  = new Intent(getApplicationContext(), SmsSync.class);
				startActivity(intent);
			}
		});
	}

}
